﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;

namespace Demo05.Controls
{
    class MapSelector: DataTemplateSelector
    {
        protected override Windows.UI.Xaml.DataTemplate SelectTemplateCore(object item, Windows.UI.Xaml.DependencyObject container)
        {
            var x = item as Models.Item;
            if (x.Truck)
                return this.TruckTemplate;
            return this.CarTemplate;
        }

        public Windows.UI.Xaml.DataTemplate CarTemplate { get; set; }
        public Windows.UI.Xaml.DataTemplate TruckTemplate { get; set; }
    }
}
